int ray_intersect(vector& ro,vector& rd,float& tnear,float& tfar)
Parameter | Type | Description |
---|---|---|
ro | vector& | ray origin |
rd | vector& | ray direction |
tnear | float& | returns near collision distance |
tfar | float& | returns far collision distance |
Returns 0 if no collision is found, otherwise a collision was found.
This method computes a ray intersection with the bounding box.
If a collision is found, the tnear and tfar parameters will
be set to the distance from the ray origin where the ray intersected the bounding box.